<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="${basePackage}.adapter.driving.query.${module}.mapper.${className}QueryMapper">

  <sql id="pageWhere">
    <where>
    </where>
  </sql>

  <select id="countPageByCondition" resultType="long">
    SELECT count(*) FROM ${tableName}
    <include refid="pageWhere"/>
  </select>

  <select id="selectPageByCondition" resultType="${basePackage}.adapter.driving.query.${module}.po.${className}QueryPo">
    SELECT
      <#list fields as field>
      ${field.columnName}<#if field_has_next>, </#if>
      </#list>
    FROM ${tableName}
    <include refid="pageWhere"/>
     ORDER BY id DESC
     LIMIT ${"#{"+_abcde!'startRow'+"}"},${"#{"+_abcde!'pageSize'+"}"}
  </select>

</mapper>
